﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using static SEGIService.SGModel.SigeCommunityResult;

namespace SEGIService.SGModel
{
    /// <summary>
    /// 工单跟踪记录响应根对象
    /// </summary>
    public class WorkOrderTrackResponse
    {
        /// <summary>
        /// 响应代码（0表示成功）
        /// </summary>
        [JsonPropertyName("code")]
        public string Code { get; set; }

        /// <summary>
        /// 响应消息
        /// </summary>
        [JsonPropertyName("message")]
        public string Message { get; set; }

        /// <summary>
        /// 跟踪记录数据列表
        /// </summary>
        [JsonPropertyName("data")]
        public List<WorkOrderTrackItem> Data { get; set; } = new List<WorkOrderTrackItem>();
    }

    /// <summary>
    /// 工单跟踪记录项
    /// </summary>
    public class WorkOrderTrackItem
    {
        /// <summary>
        /// 跟踪记录ID
        /// </summary>
        [JsonPropertyName("trackId")]
        public string TrackId { get; set; }

        /// <summary>
        /// 跟踪节点编码
        /// </summary>
        [JsonPropertyName("trackCode")]
        public string TrackCode { get; set; }

        /// <summary>
        /// 跟踪节点名称
        /// </summary>
        [JsonPropertyName("trackName")]
        public string TrackName { get; set; }

        /// <summary>
        /// 跟踪状态（0: 待处理, 1: 已处理等）
        /// </summary>
        [JsonPropertyName("trackStatus")]
        public string TrackStatus { get; set; }

        /// <summary>
        /// 记录创建时间（格式：yyyy-MM-dd HH:mm:ss）
        /// </summary>
        [JsonPropertyName("createDate")]
        public string CreateDate { get; set; }

        /// <summary>
        /// 跟踪信息描述
        /// </summary>
        [JsonPropertyName("trackInfo")]
        public string TrackInfo { get; set; }

        /// <summary>
        /// 处理建议
        /// </summary>
        [JsonPropertyName("dealAdvise")]
        public string DealAdvise { get; set; }

        /// <summary>
        /// 处理照片（多个URL用逗号分隔）
        /// </summary>
        [JsonPropertyName("dealPhotos")]
        public string DealPhotos { get; set; }

        /// <summary>
        /// 处理签名照片
        /// </summary>
        [JsonPropertyName("dealSignPhotos")]
        public string DealSignPhotos { get; set; }

        /// <summary>
        /// 处理人
        /// </summary>
        [JsonPropertyName("handler")]
        public string Handler { get; set; }

        /// <summary>
        /// 协作人员
        /// </summary>
        [JsonPropertyName("teamworks")]
        public string Teamworks { get; set; }

        /// <summary>
        /// 处理时间（格式：yyyy-MM-dd HH:mm:ss）
        /// </summary>
        [JsonPropertyName("handleDate")]
        public string HandleDate { get; set; }
    }

    /// <summary>
    /// 工单列表成功返回
    /// </summary>
    public class SigeWorkListResponse
    {
        /// <summary>
        /// 响应代码（0表示成功）
        /// </summary>
        [JsonPropertyName("code")]
        public string Code { get; set; }

        /// <summary>
        /// 响应消息
        /// </summary>
        [JsonPropertyName("message")]
        public string Message { get; set; }

        /// <summary>
        /// 服务数据列表
        /// </summary>
        [JsonPropertyName("data")]
        public SigeWorkListData Data { get; set; } = new SigeWorkListData();
    }

    public class SigeWorkListData
    {
        /// <summary>
        /// 工单列表
        /// </summary>
        [JsonPropertyName("orderList")]
        public List<OrderItem> OrderList { get; set; } = new List<OrderItem>();

        /// <summary>
        /// 分页信息
        /// </summary>
        [JsonPropertyName("paginator")]
        public Paginator Paginator { get; set; } = new Paginator();
    }

    /// <summary>
    /// 工单列表成功返回
    /// </summary>
    public class OrderItem
    {
        /// <summary>
        /// 服务工单ID
        /// </summary>
        [JsonPropertyName("serviceOrderId")]
        public string ServiceOrderId { get; set; }

        /// <summary>
        /// 服务工单号
        /// </summary>
        [JsonPropertyName("serviceOrderCode")]
        public string ServiceOrderCode { get; set; }

        /// <summary>
        /// 工单状态编码
        /// </summary>
        [JsonPropertyName("serviceOrderState")]
        public string ServiceOrderState { get; set; }

        /// <summary>
        /// 工单状态名称
        /// </summary>
        [JsonPropertyName("serviceOrderStateName")]
        public string ServiceOrderStateName { get; set; }

    }

    /// <summary>
    /// 工单添加成功返回
    /// </summary>
    public class SigeWorkAddTrueResponse
    {
        /// <summary>
        /// 响应代码（0表示成功）
        /// </summary>
        [JsonPropertyName("code")]
        public string Code { get; set; }

        /// <summary>
        /// 响应消息
        /// </summary>
        [JsonPropertyName("message")]
        public string Message { get; set; }

        /// <summary>
        /// 服务数据列表
        /// </summary>
        [JsonPropertyName("data")]
        public serviceOrderAddT Data { get; set; } = new serviceOrderAddT();
    }

    /// <summary>
    /// 工单类别返回
    /// </summary>
    public class SigeWorkTypeResponse
    {
        /// <summary>
        /// 响应代码（0表示成功）
        /// </summary>
        [JsonPropertyName("code")]
        public string Code { get; set; }

        /// <summary>
        /// 响应消息
        /// </summary>
        [JsonPropertyName("message")]
        public string Message { get; set; }

        /// <summary>
        /// 服务数据列表
        /// </summary>
        [JsonPropertyName("data")]
        public List<ServiceItem> Data { get; set; } = new List<ServiceItem>();
    }

    /// <summary>
    /// 服务项详情
    /// </summary>
    public class ServiceItem
    {
        /// <summary>
        /// 服务类型编码
        /// </summary>
        [JsonPropertyName("serviceTypeCode")]
        public string ServiceTypeCode { get; set; }

        /// <summary>
        /// 服务类型名称
        /// </summary>
        [JsonPropertyName("serviceTypeName")]
        public string ServiceTypeName { get; set; }

        /// <summary>
        /// 模板实例ID
        /// </summary>
        [JsonPropertyName("templateInstId")]
        public string TemplateInstId { get; set; }

        /// <summary>
        /// 模板差异ID
        /// </summary>
        [JsonPropertyName("templateDifId")]
        public string TemplateDifId { get; set; }

        /// <summary>
        /// 服务图标URL
        /// </summary>
        [JsonPropertyName("icon")]
        public string Icon { get; set; }

        /// <summary>
        /// 排序序号
        /// </summary>
        [JsonPropertyName("seq")]
        public string Seq { get; set; }

        /// <summary>
        /// 业务类型列表
        /// </summary>
        [JsonPropertyName("busiType")]
        public List<BusiType> BusiType { get; set; } = new List<BusiType>();
    }

    /// <summary>
    /// 业务类型详情
    /// </summary>
    public class BusiType
    {
        /// <summary>
        /// 业务类型ID
        /// </summary>
        [JsonPropertyName("busiTypeId")]
        public string BusiTypeId { get; set; }

        /// <summary>
        /// 业务名称
        /// </summary>
        [JsonPropertyName("busiName")]
        public string BusiName { get; set; }

        /// <summary>
        /// 业务编码
        /// </summary>
        [JsonPropertyName("busiCode")]
        public string BusiCode { get; set; }
    }

    /// <summary>
    /// 新增报事成功
    /// </summary>
    public class serviceOrderAddT
    {
        /// <summary>
        /// 报事单id
        /// </summary>
        [JsonPropertyName("serviceOrderId")]
        public string serviceOrderId { get; set; }

    }
}
